<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<jsp:useBean id="bs" class="weaver.general.BaseBean"/>
<%
    //接收参数
    String type = Util.null2String(request.getParameter("type"));//类型  1：请假  2：加班
    String id =  Util.null2String(request.getParameter("id"));//姓名
    String startTime =  Util.null2String(request.getParameter("startTime"));//开始时间
    String endTime =  Util.null2String(request.getParameter("endTime"));//结束时间
    String days =  Util.null2String(request.getParameter("days"));//请假天数
    String leaveType =  Util.null2String(request.getParameter("leaveType"));//请假类型
%>

<%
    RecordSet rs = new RecordSet();
    PrintWriter writer = response.getWriter();
    String sql = "";
    if ("1".equals(type)){
        //请假
        //准备参数
        String startDate = startTime.split(" ")[0];
        startTime = startTime.split(" ")[1];
        String endDate = endTime.split(" ")[0];
        endTime = endTime.split(" ")[1];

       //查询人员请假事由
        sql = "select xjyy2 from formtable_main_2 where ksrq = '"+startDate+"' and kssj = '"+startTime+"' and jsrq = '"+endDate+"' and jssj = '"+endTime+"' and sqr = '"+id+"'  and qjlx = '"+leaveType+"' and ts = '"+days+"'";
        rs.execute(sql);
        if(rs.next()){
            //请假事由
            String qjsy = rs.getString("xjyy2");
            writer.write(qjsy);
            writer.close();
            return;
        }
    }else if("2".equals(type)){
        //加班
    }


%>